
<%@ page import="ihotel.Hospedagem" %>
<!DOCTYPE html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'hospedagem.label', default: 'Hospedagem')}" />
		<title><g:message code="default.list.label" args="[entityName]" /></title>
	</head>
	<body>
		<a href="#list-hospedagem" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
		<div class="nav" role="navigation">
			<ul>
				<li><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li>
				<li><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></li>
			</ul>
		</div>
		<div id="list-hospedagem" class="content scaffold-list" role="main">
			<h1><g:message code="default.list.label" args="[entityName]" /></h1>
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<table>
				<thead>
					<tr>
						
						<g:sortableColumn property="numeroQuarto" title="${message(code: 'hospedagem.numeroQuarto.label', default: 'Numero Quarto')}" />
						
						<g:sortableColumn property="hospede" title="${message(code: 'hospedagem.hospede.label', default: 'Hospede')}" />
						
						<g:sortableColumn property="dataCheckout" title="${message(code: 'hospedagem.dataCheckout.label', default: 'Data Checkout')}" />
					
						<g:sortableColumn property="dataCheckin" title="${message(code: 'hospedagem.dataCheckin.label', default: 'Data Checkin')}" />
					
						<g:sortableColumn property="totalDiaria" title="${message(code: 'hospedagem.totalDiaria.label', default: 'Total Diaria')}" />
					
						<g:sortableColumn property="valorDiaria" title="${message(code: 'hospedagem.valorDiaria.label', default: 'Valor Diaria')}" />
					
						<g:sortableColumn property="totalPagar" title="${message(code: 'hospedagem.totalPagar.label', default: 'Total Pagar')}" />
						
						<th></th>
					
					</tr>
				</thead>
				<tbody>
				<g:each in="${hospedagemInstanceList}" status="i" var="hospedagemInstance">
					<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
					
						<td><g:link action="show" id="${hospedagemInstance.id}">${fieldValue(bean: hospedagemInstance, field: "numeroQuarto")}</g:link></td>
						
						<td><g:link action="show" id="${hospedagemInstance.id}">${fieldValue(bean: hospedagemInstance, field: "hospede.nome")}</g:link></td>
						
						<td><g:formatDate date="${hospedagemInstance.dataCheckout}" /></td>
					
						<td><g:formatDate date="${hospedagemInstance.dataCheckin}" /></td>
					
						<td>${fieldValue(bean: hospedagemInstance, field: "totalDiaria")}</td>
					
						<td>${fieldValue(bean: hospedagemInstance, field: "valorDiaria")}</td>
					
						<td>${fieldValue(bean: hospedagemInstance, field: "totalPagar")}</td>
						
						<td>
						  <g:if test="${hospedagemInstance?.finalizado}">
						    Finalizado
						  </g:if>
						   <g:else>
						    <g:link action="checkout" id="${hospedagemInstance.id}">Checkout</g:link>
						  </g:else>
						
						</td>
																							
					</tr>
				</g:each>
				</tbody>
			</table>
			<div class="pagination">
				<g:paginate total="${hospedagemInstanceTotal}" />
			</div>
		</div>
	</body>
</html>
